<template>
  <el-button
    plain
    type="primary"
    class="px-[10px] refresh-btn"
    @click="$emit('click')"
  >
    <el-icon :class="loading && 'animate-spin'">
      <refresh-right />
    </el-icon>
  </el-button>
</template>

<script setup lang="ts">
import { RefreshRight } from '@element-plus/icons-vue'

interface IProps {
  loading: boolean
}

interface IEmit {
  (event: 'click'): void
}

defineProps<IProps>()
defineEmits<IEmit>()
</script>
